$(function(){
    var windowHeight = $(window).height();
    var windowWidth = $(window).width();
    //设置元素的默认高度或者距离
    $('.container').height(windowHeight);
    $('.shadowContent').height(windowHeight);
    $('.squareContent').css({
        'height':windowHeight,
        'background-position-y':(windowHeight-203)/2+'px',
        'background-position-x':(windowWidth-1022)/2+'px'
    });

    var panelHeight = $('.panelContent').height();
    $('.panelContent').css('padding-top',(windowHeight-panelHeight)/2);

    //鼠标移动
    var beforeX = 0;
    var beforeY = 0;
    $(document).mouseenter(function(e){
        beforeX = e.pageX;
        beforeY = e.pageY;
    });
    $(document).mousemove(function(e){
        var pointX = e.pageX;
        var pointY = e.pageY;
        var bgX = $('.squareContent').css('background-position-x');
        var bgY = $('.squareContent').css('background-position-y');
        $('.squareContent').css({
            'background-position-x':parseFloat(bgX)+(pointX-beforeX)/50+'px',
            'background-position-y':parseFloat(bgY)+(pointY-beforeY)/50+'px'
        });
        beforeX = pointX;
        beforeY = pointY;
    });
});